package com.yogee.topseller.fragment;

import android.app.Dialog;
import android.app.DialogFragment;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import com.yogee.topseller.interfaces.MyListener;
import com.yogee.topseller.R;
import com.yogee.topseller.utils.AppUtil;


/**
 * Created by Administrator on 2016/9/16.
 */
public class NetDialogFragment extends DialogFragment {

    private MyListener listener;

    public void setListener(MyListener listener){
        this.listener = listener;
    }

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        final Dialog mDetailDialog = new Dialog(getActivity(), R.style.dialog);
        mDetailDialog.setContentView(R.layout.pop_net);
        mDetailDialog.setCancelable(false);
        TextView refresh_tv = (TextView) mDetailDialog.findViewById(R.id.refresh_tv);
        refresh_tv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mDetailDialog.dismiss();
                AppUtil.flag = true;
                listener.reload();
            }
        });

        return mDetailDialog;
    }


}
